package com.shaoman.customer.view.activity

import android.content.Context
import android.os.Bundle
import android.webkit.WebView
import androidx.core.os.bundleOf
import com.shaoman.customer.view.activity.base.BaseWebViewActivity
import com.shenghuai.bclient.stores.util.ActivityUtil

class WebViewActivity : BaseWebViewActivity() {

    companion object {
        fun launch(ctx: Context, url: String) {
            val b = bundleOf(Pair("url", url))
            ActivityUtil.start(ctx, WebViewActivity::class.java, b)
        }
    }

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        val url = intent.getStringExtra("url")
        if (!url.isNullOrEmpty())
            setWillLoadUrl(url)
    }

    override fun isJsEnabled(): Boolean {
        return true
    }

    override fun configWebView(webView: WebView) {
    }

}